﻿<BadHabit_WPFTools:ShapedWindow
    x:Name="window"
    x:Class="BadHabit.Factory.Views.Settings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:BadHabit_Factory_Controls="clr-namespace:BadHabit.Factory.Controls"  
    xmlns:BadHabit_WPFTools="clr-namespace:BadHabit.WPFTools;assembly=BadHabit.WPFTools"
    xmlns:props="clr-namespace:BadHabit.Factory.Windows.Properties"  
    
    
    Title="{x:Static props:Resources.The_Scrum_Factory_Settings}"
    Width="550"                  
    MinHeight="300"
    SizeToContent="Height"
    
    Style="{StaticResource DialogEditWindow}"
    
    Topmost="True"
    
    WindowStartupLocation="CenterScreen"
    
    Loaded="Settings_Loaded"
    SnapsToDevicePixels="True"
    
    >

    <BadHabit_WPFTools:ShapedWindow.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Undo" Executed="Undo_Executed"/>
        <CommandBinding Command="ApplicationCommands.Save" Executed="Save_Executed"/>
    </BadHabit_WPFTools:ShapedWindow.CommandBindings>
    
    <TabControl Margin="0,5,0,0">
        <TabItem Header="{x:Static props:Resources.Preferences}">
            <StackPanel Orientation="Vertical">
                <CheckBox IsChecked="{Binding StartWithWindows}" Style="{StaticResource FormCheckBox}" Content="{x:Static props:Resources.Starts_on_windows_start_up}"/>
                <CheckBox IsChecked="{Binding TaskTrackActive}" Style="{StaticResource FormCheckBox}"  Content="{x:Static props:Resources.Task_track_active}"/>
                <CheckBox IsChecked="{Binding ShowEffortBar}" Style="{StaticResource FormCheckBox}" Content="{x:Static props:Resources.Show_effort_bar}"/>
                <CheckBox IsChecked="{Binding ShowWorkingOnTaskToolTip}" Style="{StaticResource FormCheckBox}"  Content="{x:Static props:Resources.Show_working_on_task_banner}"/>
            </StackPanel>
        </TabItem>
        
        <TabItem x:Name="connectionTabItem" Header="{x:Static props:Resources.Connection}">


            <Grid HorizontalAlignment="Stretch">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <TextBlock Grid.Column="0" Grid.Row="0" Style="{StaticResource Label}" Text="{x:Static props:Resources.Factory_server_url}"/>
                <TextBox Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch" Text="{Binding ProjectWebServiceURL}" Style="{StaticResource FormTextBox}" />

                <CheckBox 
                        x:Name="useWindowsAuthenticationCheckBox"
                        Grid.ColumnSpan="2" Grid.Row="1"
                        Content="{x:Static props:Resources.Use_windows_authentication}"
                        IsChecked="{Binding UseWindowsAuthentication}"                        
                    />
                    
                    

                <GroupBox x:Name="userSettingsGroup"
                        Header="{x:Static props:Resources.Authentication}"
                          Grid.ColumnSpan="2" Grid.Row="2">
                    <GroupBox.Style>
                        <Style BasedOn="{StaticResource {x:Type GroupBox}}" TargetType="GroupBox">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding UseWindowsAuthentication}" Value="True">
                                    <Setter Property="GroupBox.Visibility" Value="Collapsed"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </GroupBox.Style>

                    <Grid HorizontalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>                            
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        
                        

                        <TextBlock
                    Grid.Column="0" Grid.Row="0"
                    Text="{x:Static props:Resources.User_id}" Style="{StaticResource Label}"/>
                        <TextBlock
                    Grid.Column="0" Grid.Row="1"                    
                    Text="{x:Static props:Resources.Access_key}" Style="{StaticResource Label}"/>
                        <TextBox
                    Grid.Column="1" Grid.Row="0"
                    Style="{StaticResource FormTextBox}"
                    TextChanged="TextBox_TextChanged"
                    Text="{Binding UserMemberId}"/>
                        <TextBox
                    Grid.Column="1" Grid.Row="1"
                    Style="{StaticResource FormTextBox}"
                    TextChanged="TextBox_TextChanged"
                    Text="{Binding UserAccessKey}"/>
                    </Grid>
                    
                    

                </GroupBox>

            </Grid>


        </TabItem>
        <TabItem Header="{x:Static props:Resources.My_Profile}" x:Name="profileTabItem">
            
                <BadHabit_Factory_Controls:TeamMemberDetail x:Name="teamMemberHeaderControl" ShowAuthenticationGroupBox="False" />
            
        </TabItem>
    </TabControl>

    

             
</BadHabit_WPFTools:ShapedWindow>
